using Core;
using Google.Protobuf.WellKnownTypes;

namespace Server;

[PlayCommand(CommandType.HeartBeat)]
public sealed class HeartBeat : PlayRespAsyncCommand<HeartbeatRequest, HeartbeatReply>
{
    protected override ValueTask<HeartbeatReply> HandlerAsync(PlaySession session, HeartbeatRequest package)
    {
        return ValueTask.FromResult(new HeartbeatReply
        {
            ServerTimestampMS = (ulong)DateTime.Now.ToTimestamp().Seconds,
        });
    }
}